package com.jfl.model;

import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.jfl.base.BaseModel;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <用户对象>
 * 
 * @author 赵炎
 * @version [V1.00, 2018年11月23日]
 * @see [相关类/方法]
 * @since V1.00
 */
@SuppressWarnings("serial")
@TableName(value = "tbl_sys_user")
@Data
@EqualsAndHashCode(callSuper = false)
public class SysUser extends BaseModel
{
    
    /**
     * 用户名
     */
    @TableField("user_name")
    private String userName;
    
    /**
     * 密码
     */
    @TableField("password")
    private String password;
    
    /**
     * 昵称
     */
    @TableField("nick_name")
    private String nickName;
    
    /**
     * 邮箱
     */
    @TableField("email")
    private String email;
    
    /**
     * 手机号码
     */
    @TableField("phone")
    private String phone;
    
    /**
     * 性别
     */
    @TableField("gender")
    private Short gender;
    
    /**
     * 地址
     */
    @TableField("address")
    private String address;
    
    /**
     * 描述
     */
    @TableField("description")
    private String description;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date loginDate;
    
    private String loginIp;
    /**
     * 部门ID
     */
    private Long deptId;
    
    @TableField(exist = false)
    private String deptName;
    
    private String status;
    
    private String avatar;
    
    private String salt;
    
    private Integer isAdmin;
    
    @TableField(exist = false)
    private SysDept dept;
    
    /** 部门父ID */
    @TableField(exist = false)
    @JsonSerialize(using=ToStringSerializer.class)
    private Long parentId;
    
    @TableField(exist = false)
    private List<SysRole> roles;
    
    @TableField(exist = false)
    private Long[] roleIds;
    
    @TableField(exist = false)
    private Long[] postIds;
}
